<template lang="pug">
  div.child-1
    h1 组件 Child1
    div(v-show="isVisble")
      h3
        b {{title}}
        |  的 DIV
    ul
      li(v-for="item in items" v-bind:key="item" v-on:click="onItemClick(item)") {{item}}
</template>

<script type="text/ecmascript-6">
  export default {
    props: {
      title: {
        type: String,
        default: '标题'
      },
      items: {
        type: Array,
        default() {
          return []
        }
      }
    },
    data() {
      return {
        isVisble: true
      }
    },
    methods: {
      onItemClick(item) {
        this.$emit('onItemClick', item)
      },
      toggleDiv() {
        this.isVisble = !this.isVisble
      }
    }
  }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
</style>
